#include "SyncMessage.h"

SyncMessage::SyncMessage(int source, int destination, int num_of_nodes, int creator):Message(source, destination)
{
	//printf("syncMessage constructor\n");
	m_flags = new map<int,int>();
	m_course = new stack<int>();
	m_creator = creator;
	m_num_of_nodes = num_of_nodes;
}

SyncMessage::~SyncMessage(void)
{
	delete m_flags;
	delete m_course;
}

void SyncMessage::setDestination(int source, int dest)
{
	m_destination = dest;
	m_source = source;
}

void SyncMessage::run(Node* n)
{
	//printf("running syncMessage\n");
	n->syncMessageProc(this);
}
	
void SyncMessage::print()
{
	//printf("Sync Message from node: %d message steps: %d\n", m_creator, m_counter);
	printf("The processes are synchronized\n");
}

